-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
You mean to clean the sample? most of the code is to retrieve info from the playing. I looked to other addons and they all use almost exactly this code....so I think it's good to have it into provide something ready. |
Coverage remained the same at 100.0% when pulling 6dd959f6c43ea0374c1f6530735e3101f32ec479 on subtitle-type into 761f4d7 on master. |
Well I just thought it might scare people away that just started doing addons. |
Subtitle addons are really basic stuff and they just have to respond to specific parameters. I understand that it's a lot of code. we could drop the code to gather info and download the subtitle but it's something that ALL subtitle addons need to chose what subtitle display and to save the file.. The alternative is to use/create some extra module to hide this so that all subtitle addons might use.. |
Well let's wait for some third party people like @MartijnKaijser @phil65 or @enen92 reviewing this. |
@@ -0,0 +1,109 @@ | |||
import urllib2, sys, urlparse, urllib, os, unicodedata |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
SCRIPT_ID = ADDON.getAddonInfo('id') | ||
PROFILE = xbmc.translatePath(ADDON.getAddonInfo('profile')) | ||
TEMP = os.path.join( PROFILE, 'temp', '') | ||
HANDLE=int(sys.argv[1]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
#function to retrieve parameters in a dictionary | ||
def getParams(): | ||
if len(sys.argv) > 2: | ||
return dict(urlparse.parse_qsl(sys.argv[2].lstrip(b'?'))) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
def getInfo(): | ||
item = {} | ||
item['temp'] = False |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Subtitles.py uses camelCase, PascalCase and the pep-8 recommendation of lowercase and underscores mixed together for functions. I think we should provide a consistent base in that regard if this is to be a template. |
6dd959f
to
5770d9d
Compare
Run Pep8 on the Subtitles.py file, all errors fixed apart from 2-3 lines too long. |
Coverage remained the same at 100.0% when pulling 5770d9d63e70bd9cd0a07cbdb5878e712084e447 on subtitle-type into 761f4d7 on master. |
5770d9d
to
53f7d0e
Compare
1 similar comment
I would like to merge this. @phate89 could you do a followup PR with some more code comments? I feel like I understand to less about some of the stuff set here. |
@razzeee yes sure.. anyway what code style we want to use for variables/functions? to have a single one everywhere |
@phil65 should answere that, he's far more into the python stuff |
Please review.
subtitles.py
done by @phate89I feel like there is still some stuff to get rid off. So let's talk about that.
And I'm not sure if I should have replaced some of the stuff with placeholders?